package com.cedric.yixianpai.game.cards.Sects.swordCards.a_LianQi;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 灵气灌注 灵气+2/3/4
 */
@Component
public class LingQiGuanZhu extends SwordCard {
    public LingQiGuanZhu(@Value("1") int lvl) {
        super("灵气灌注");
        this.setLevel(lvl);
        this.setPeriod(Period.LIANQI);
        this.setDescription("灵气+2/3/4,下一次攻击无视防御");

        if (1 == lvl) {
            this.setSpiritAdd(2);
        } else if (2 == lvl) {
            this.setSpiritAdd(3);
        } else if (3 == lvl) {
            this.setSpiritAdd(4);
        }else{
            throw new RuntimeException("错误的卡牌等级！");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addSpiritualEnergy(this.getSpiritAdd());
        Sta1.getPlayerBuff().addIgnoreDefense(1);
        return true;
    }
}
